import { getRequest, postRequest, putRequest, deleteRequest } from '/src/lib/axios';
import { localRead } from '/@/utils/local-util';
import LocalStorageKeyConst from '/@/constants/local-storage-key-const.js';
const token = localRead(LocalStorageKeyConst.WVP_TOKEN);
const baseUrl = "/wvpApi/gb_record"

export const api = {
  // 查询回流地址
  downloadVideo: (param = {}) => {
    return getRequest({
      url: baseUrl + '/download/start/' + param.url,
      params: {
        startTime: param.startTime,
        endTime: param.endTime,
        downloadSpeed: 4,
      },
      header: {
        "access-token": token
      }
    });
  },

  // 进度
  getProgress: (param) => {
    return getRequest({
      url: baseUrl + '/download/progress/' + param.deviceId + "/" + param.channelId + "/" + param.stream,
      header: {
        "access-token": token
      }
    });
  },

  // 进度
  stopDownload: (param) => {
    return getRequest({
      url: baseUrl + '/download/stop/' + param.deviceId + "/" + param.channelId + "/" + param.stream,
      header: {
        "access-token": token
      }
    });
  },
};
